# -*-coding:utf-8 -*-
from django.db import models
from time import *
from taggit.managers import TaggableManager
from django.contrib.auth.models import User
#from ckeditor.widgets import CKEditorWidget
from ckeditor.fields import RichTextField

# Create your models here.
class Profile(models.Model):
	user = models.ForeignKey(User)
	oauth_token = models.CharField(max_length=200)
	oauth_secret = models.CharField(max_length=200)
	
class Category(models.Model):
	name =  models.CharField(max_length=200)

# class Tag(db.Model):
# 	name =  models.CharField(max_length=200)

class Post(models.Model):
	title = models.CharField(max_length=200)
	body =  RichTextField(config_name='default')
	permalink = models.CharField(max_length=200)
	pub_date = models.DateTimeField(auto_now=True,verbose_name='发布日期')
	category = models.ForeignKey(Category,verbose_name="分类",blank=True,null=True)
	#tags = models.ManyToManyField(Phoneseries,verbose_name="标签",blank=True,null=True)
	tags = TaggableManager()
	profile = models.ForeignKey(Profile,verbose_name="用户",blank=True,null=True)